package com.partner.service.product;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.partner.bean.product.Product;
import com.partner.mapper.product.ProductMapper;

@Service("product")
public class ProductService {

	@Autowired
	private ProductMapper productMapper;
	
	public ProductMapper getServiceMapper() {
		return productMapper;
	}
	
	public int insert(Product s) {
		int id =0 ;	
		try {
		   id =	productMapper.insert(s);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return id ;
	}
	
	public List<Product> selectAll(Product product) {
		return productMapper.selectAll(product);
	}
	
	public Product selectByPrimaryId(Integer id){
		return productMapper.selectByPrimaryId(id);
	}
	
	public int removeByPrimaryKey(Integer id){
		return productMapper.deleteByPrimaryKey(id);
	}
	
	public int deleteByids(String[] ids){
		return productMapper.deleteByids(ids);
	}
	
	public int updateByPrimaryKey(Product product){
		return productMapper.updateByPrimaryKey(product);
	}

}
